package jp.ddo.trismegistos.controller;

import jp.ddo.trismegistos.framework.annotation.ServiceClass;
import jp.ddo.trismegistos.framework.controller.Controller;
import jp.ddo.trismegistos.framework.controller.Navigation;
import jp.ddo.trismegistos.framework.util.CopyUtil;
import jp.ddo.trismegistos.service.EventService;
import jp.ddo.trismegistos.vo.Event;

public class CreateController extends Controller {

	@ServiceClass
	protected EventService eventService;

	@Override
	protected Navigation run() throws Exception {
		final Event event = new Event();
		CopyUtil.copy(event, requestMap);

		eventService.addEvent(event);
		requestScope("event", event);
		return forward("detail.jsp");
	}

	@Override
	protected boolean doubleSubmitCheck() {
		return true;
	}

}
